import request from './request.js';
let service = request.service;
let download = request.download;
export default {
  /**创建每日任务*/
  insertEverDayTask() {
    return service({
      url: `/adscm/operation/taskManager/insertEverDayTask`, 
      method: 'post'
    })
  },
  /**创建周总结*/
  insertWeekTask() {
    return service({
      url: `/adscm/operation/taskManager/insertWeekTask`, 
      method: 'post'
    })
  },
  /***创建每日任务 */
  insertMonthTask() {
    return service({
      url: `/adscm/operation/taskManager/insertMonthTask`,
      method: 'post'
    })
  },
  /**新增-insert 修改-update 下发的任务 */
  insertUpdateIssuedTask(type,data){
    return service({
      url: `/adscm/operation/taskManager/${type}`,
      method: 'post',
      data
    })
  },
  /**获取任务过程列表 */
  taskManagerdetail(id) {
    return service({
      url: `/adscm/operation/taskManagerdetail/selectByTid/${id}`,   
      method: 'get'
    })
  },
  /**新增修改任务过程信息 */
  insertUpdateProcessDetail(type, data) {
    return service({
      url: `/adscm/operation/taskManagerdetail/${type}`, //type: insert-新增任务过程 update-修改任务过程
      method: 'post',
      data
    })
  },
  /**删除任务过程信息 */
  deleteTaskProcessDetail(id) {
    return service({
      url: `/adscm/operation/taskManagerdetail/delete/${id}`, 
      method: 'get'
    })
  },
  /**上传使用说明url */
  uploadInstructionsUrl(){
    return download({
      url: `/adscm/operation/jySoftDescription/upload/1`
    })
  },
  /**预览使用说明url */
  viewInstructionsUrl() {
    return download({
        url: `/adscm/operation/jySoftDescription/view/1`
    })
  },
  /**下载使用说明url */
  downloadInstructionsUrl(){
    return download({
        url: `/adscm/operation/jySoftDescription/downloadPdf/1`
    })
  },
  /**获取下发任务说明列表 */
  getTaskInfoList(id) {
    return service({
      url: `/adscm/operation/taskManagerinfo/selectByTid/1/${id}`,
      method: 'get'
    })
  },
  /**新增-insert update-修改 1-任务说明 2-任务接收说明 */
  insertUpdateTaskInfo(data,type,taskType) {
    return service({
        url: `/adscm/operation/taskManagerinfo/${type}${taskType?('/'+taskType):''}`,
        method: 'post',
        data
    })
  },
  /**获取下发任务接收说明列表 */
  getTaskReceiveList(id) {
    return service({
      url: `/adscm/operation/taskManagerinfo/selectByTid/2/${id}`,
      method: 'get'
    })
  },
 
  /***删除下发的任务 */
  deleteTask1(id) {
     return service({
        url: `/adscm/operation/taskManager/delete/${id}`,
        method: 'get'
     })
  },
  /***删除任务 */
  deleteTask2(id) {
    return service({
      url: `/adscm/operation/taskManager/deleteDB/${id}`,
      method: 'get'
    })
  },
  /***获取附件列表 */
  getEnclosureList(id) {
    return service({
      url: `/adscm/operation/taskManagerAttchment/selectByFileId/${id}`,
      method: 'get'
    })
  },
  /**新增附件 附件上传*/
  insertEnclosure(data) {
    return service({
        url: `/adscm/operation/taskManagerAttchment/upload`,
        method: 'post',
        data
    }, 'upload')
  },
  /**删除附件 */
  deleteEnclosure(id){
    return service({
      url: `//adscm/operation/taskManagerAttchment/delete/${id}`,
      method: 'get'
    })
  },
  /**下载附件 */
  downloadEnclosure(id) {
     return download({
        url: `/adscm/operation/taskManagerAttchment/download/${id}`
     })
  },
  /**获取所有交办的任务列表 */
  allTaskManager(data){
    return service({
      url: `/adscm/operation/taskManager/selectAllTaskManager`,
      method: 'post',
      data
    })
  }
}